﻿@model BastInfos.Models.Event.EventListModel

@{
	ViewBag.Title = "Listes des Evenements" + (Model.Category != null ? " : " + Model.Category.Description : String.Empty);
}

<div id="content">
	<h1><span>Liste des Evenements <em>@if (Model.Category != null) {  <text>: @Model.Category.Description</text> } </em></span></h1>
	<br /><br />
	@Model.Calendar1.Render() 
	@Model.Calendar2.Render() 
	<br class="clear" /><br />
	@foreach (var evt in Model.Events) { 
		<a name="event-@evt.id_Event " id="event-@evt.id_Event "></a>
		<div class="news_bloc">
			<h3>@String.Format("{0:d}", evt.EventDate)  - @Html.Raw(evt.Title) </h3>
			<br />
			<p>
				@Html.Raw(evt.Summary) 
			</p>
			<br />
			<p class="p_right">@Html.RouteLink("Cliquez ici pour en savoir plus", "Event", new { title = evt.Title, id = evt.id_Event }) </p>
		</div>
		<br />
	} 
	<br />
	<div class="pager">
		<div class="prev">@if (Model.CurrentPage == 1) { <text>&nbsp;</text> } else { <a href="?page=@(Model.CurrentPage - 1)">Précédent</a> }</div>
		<div class="pages">
			Pages : 
			@for (int i = 1; i <= Model.PagesNumber; i++) { 
				if(i == Model.CurrentPage) { 
					<span>@i</span>
				} else { 
					<a href="?page=@i">@i</a>
				} 
			} 
		</div>
		<div class="next">@if (Model.CurrentPage == Model.PagesNumber) { <text>&nbsp;</text> } else { <a href="?page=@(Model.CurrentPage + 1)">Suivant</a> }</div>
		<br class="clear" />
	</div>
	<br/>
	<a href="#haut">Retour en haut de la page</a>
</div>